plugins {
    id 'com.android.application'
    id 'org.jetbrains.kotlin.android'
}

android {
    compileSdk 33
    namespace 'com.nasa_gallery'
    defaultConfig {
        applicationId "com.nasa_gallery"
        minSdk 31
        targetSdk 33
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    buildTypes.each {
        Properties properties = new Properties()
        properties.load(project.rootProject.file("app.properties").newDataInputStream())
        def nasaApiKey = properties.getProperty("NASA_API_KEY", "")
        it.buildConfigField "String", "NASA_API_KEY", nasaApiKey
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_17
        targetCompatibility JavaVersion.VERSION_17
    }
    kotlinOptions {
        jvmTarget = '17'
    }
    buildFeatures {
        viewBinding true
        buildConfig true
    }
}

dependencies {
    //tutorial
    implementation 'com.github.mreram:showcaseview:1.4.0'
    //Core
    implementation 'androidx.appcompat:appcompat:1.6.0'
    implementation 'androidx.core:core-ktx:1.9.0'

    //UI
    implementation 'com.google.android.material:material:1.9.0-alpha01'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'

    //Retrofit
    implementation 'com.squareup.retrofit2:retrofit:2.9.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
    implementation 'com.squareup.okhttp3:logging-interceptor:4.9.2'

    //Lifecycle and ViewModel
    implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
    implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1'

    //Coil image download
    implementation 'io.coil-kt:coil:1.4.0'
    implementation 'io.coil-kt:coil:1.4.0'
    implementation 'androidx.navigation:navigation-fragment-ktx:2.5.3'
    implementation 'androidx.navigation:navigation-ui-ktx:2.5.3'

    //Test
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.5'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}